package com.zhengke.controller.hubf;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zhengke.pojo.AjaxResult;
import com.zhengke.pojo.CreateQrcode;
import com.zhengke.pojo.MyVerifyCode;



@Controller
@RequestMapping("qrcode")
public class QrcodeGetController {
	
	/**
	 * qrcode二维码的生成的方法的调用
	 */
	@RequestMapping("/createQrcodeMethod.do")
	@ResponseBody
	public AjaxResult createNewQrcodeMethod(HttpServletRequest request, HttpServletResponse response, ModelMap model,String tempid ) {
		System.out.println(tempid);
		//自动生成4位的验证码信息
		String suijiString = MyVerifyCode.getQrcoxeString(4);
		System.err.println("-------------------------"+suijiString+"----------------------");
		//将验证信息放到域中去
		HttpSession session = request.getSession();
		session.setAttribute("qrcodeString",suijiString);
		CreateQrcode.createMessagePicture(suijiString);
		return new AjaxResult("200","@刷新成功@");
	}
}
